<?php
session_start();
include_once($_SERVER["DOCUMENT_ROOT"].'/public/func.php');
$config=include_once($_SERVER["DOCUMENT_ROOT"].'/public/config.php');
$_POST['userpass']=md5($_POST['userpass']);
$qal =add($config,'users',$_POST);

if ($qal) {
  echo '<script>alert("注册成功");window.location.href="login.php"</script>';
}else{
  '<script>alert("注册失败");window.location.href="zhuce.php"</script>';
};
?>